﻿<%@ Control Language="C#"  AutoEventWireup="true" CodeFile="crlSideEditor.ascx.cs" Inherits="Ctl_SideEditor" %>    
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
    


<table width="100%" cellpadding ="2" cellspacing ="0">
<tr >
            <td width="25%" class ="grd_td_item"  >
                <asp:ImageButton ID=btnCancel0 runat="server" 
                    ImageUrl ="~/images/grd_minus.gif" Height="20px" Width="20px" 
                    onclick="btnCancel_Click" />    
            
                <asp:Button ID="Button3" runat="server" CssClass="btn" Text=<%# "Сторона "+ Side.Litera %> 
                    OnClientClick =<%# OnFullSizeClick %> Font-Bold="True" Width="98px" />
            
                </td>
            <td style="width:25%" class ="grd_td_item_caption" >
                Литера:
                </td>
            <td  class ="grd_td_item" >          
                <asp:TextBox ID="txtLitera" Width ="98%" Text =<%# Side.Litera %> 
                    runat="server" CssClass="TextBox"></asp:TextBox>           
             <%--   <cc1:MaskedEditExtender ID="txtSurfCount0_MaskedEditExtender"
                    Mask="9"
                    runat="server"
                    MessageValidatorTip="true" 
                    OnFocusCssClass="MaskedEditFocus" 
                    OnInvalidCssClass="MaskedEditError"
                    MaskType="Number" 
                    InputDirection="LeftToRight"  
                    AcceptNegative="Left"                     
                    ErrorTooltipEnabled="True"                     
                    TargetControlID="txtSurfCount0"
                     >                     
                </cc1:MaskedEditExtender>--%>
            </td>
            </tr>
<tr >
            <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                Поверхностей:</td>
            <td  class ="grd_td_item" >                
                <asp:TextBox ID="txtSurfCount" Width ="98%" Text =<%# Side.SurfaceCount.ToString()  %> 
                    runat="server" CssClass="TextBox"></asp:TextBox>           
              <%--  <cc1:MaskedEditExtender ID="me_txtSurfCount"
                    Mask="9"
                    runat="server"
                    MessageValidatorTip="true" 
                    OnFocusCssClass="MaskedEditFocus" 
                    OnInvalidCssClass="MaskedEditError"
                    MaskType="Number" 
                    InputDirection="LeftToRight"  
                    AcceptNegative="Left"                     
                    ErrorTooltipEnabled="True"                     
                    TargetControlID="txtSurfCount"
                     >                     
                </cc1:MaskedEditExtender>--%>
             <%--   <cc1:MaskedEditValidator                 
                ControlExtender="me_txtSurfCount"
                ControlToValidate="txtSurfCount" 
                IsValidEmpty="False" 
                MaximumValue="9" 
                EmptyValueMessage="Введите число"
                InvalidValueMessage="Неверное значение"
                MaximumValueMessage="Значение > 1"
                MinimumValueMessage="Значение < 9"
                MinimumValue="1" 
                EmptyValueBlurredText="*" 
                InvalidValueBlurredMessage="*" 
                MaximumValueBlurredMessage="*" 
                MinimumValueBlurredText="*"
                Display="Dynamic" 
                TooltipMessage="Введите число: 1-9"
                 ID="mev_txtSurfCount" runat="server"></cc1:MaskedEditValidator>--%>
                                
            </td>
            </tr>
<tr >
            <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                GPR(0-1)
                </td>
            <td  class ="grd_td_item" >                
                            <asp:TextBox ID="txtGRP" Width ="98%" Text =<%# (Side.GRP==0?"":Side.GRP.ToString())  %> runat="server" CssClass="TextBox "></asp:TextBox>
               <%-- <cc1:MaskedEditExtender ID="me_txtGRP"
                    Mask="9.9"
                    runat="server"
                    MessageValidatorTip="true" 
                    OnFocusCssClass="MaskedEditFocus" 
                    OnInvalidCssClass="MaskedEditError"
                    MaskType="Number" 
                    InputDirection="LeftToRight"    
                    AcceptNegative="Left"                     
                    ErrorTooltipEnabled="True"                     
                    TargetControlID="txtGRP"
                    ClearTextOnInvalid ="false" 
                     >                     
                </cc1:MaskedEditExtender>
                <cc1:MaskedEditValidator                 
                ControlExtender="me_txtGRP"
                ControlToValidate="txtGRP" 
                IsValidEmpty="true"  
                MaximumValue="100" 
                EmptyValueMessage="Введите число 0.1-1"
                InvalidValueMessage="Неверное значение"
                MaximumValueMessage="Значение > 0"
                MinimumValueMessage="Значение < 1"
                MinimumValue="0" 
                EmptyValueBlurredText="*" 
                InvalidValueBlurredMessage="*" 
                MaximumValueBlurredMessage="*" 
                MinimumValueBlurredText="*"
                Display="Dynamic" 
                TooltipMessage="Введите число: 0.1-1"                
                ID="mev_txtGRP" runat="server"></cc1:MaskedEditValidator>--%>
                            
            </td>
            </tr>
<tr >
            <td width="25%"  style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                OTS (тыс.чел/день)
                </td>
            <td  class ="grd_td_item" >                                            
                            <asp:TextBox Width ="98%" ID="txtOTS" Text =<%# (Side.OTS==0?"":Side.OTS.ToString()) %>  runat="server" CssClass="TextBox "></asp:TextBox>
               <%-- <cc1:MaskedEditExtender ID="me_txtOTS"
                    Mask="999"
                    runat="server"
                    MessageValidatorTip="true" 
                    OnFocusCssClass="MaskedEditFocus" 
                    OnInvalidCssClass="MaskedEditError"                                        
                    InputDirection="LeftToRight"    
                    AcceptNegative="Left"                     
                    ErrorTooltipEnabled="True"                     
                    TargetControlID="txtOTS"
                    ClearTextOnInvalid ="false" 
                     >                     
                </cc1:MaskedEditExtender>
                <cc1:MaskedEditValidator                 
                ControlExtender="me_txtOTS"
                ControlToValidate="txtOTS" 
                IsValidEmpty="true"  
                MaximumValue="100" 
                EmptyValueMessage="Введите число 1-100"
                InvalidValueMessage="Неверное значение"
                MaximumValueMessage="Значение > 0"
                MinimumValueMessage="Значение < 100"
                MinimumValue="0" 
                EmptyValueBlurredText="*" 
                InvalidValueBlurredMessage="*" 
                MaximumValueBlurredMessage="*" 
                MinimumValueBlurredText="*"
                Display="Dynamic" 
                TooltipMessage="Введите число: 1-100"                
                ID="mev_txtOTS" runat="server"></cc1:MaskedEditValidator>--%>
            </td>
            </tr>
<tr >
            <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                            Напр. движения:</td>
            <td  class ="grd_td_item" >                
                            <asp:TextBox Width ="98%" ID="txtDirection" Text =<%# Side.Direction %>  runat="server" CssClass="TextBox "></asp:TextBox>
            </td>
            </tr>
<tr >
            <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                
            </td>
            <td style="width:25%" class ="grd_td_item_caption" >
                            Видимость (m)</td>
            <td  class ="grd_td_item" >                
                <asp:TextBox Width ="98%" ID="txtLookDistance" Text =<%# Side.LookDistance %> runat="server" CssClass="TextBox "></asp:TextBox>
             <%--   <cc1:MaskedEditExtender ID="me_txtLookDistance"
                    Mask="999"
                    runat="server"
                    MessageValidatorTip="true" 
                    OnFocusCssClass="MaskedEditFocus" 
                    OnInvalidCssClass="MaskedEditError"
                    
                    InputDirection="LeftToRight"    
                    AcceptNegative="Left"                     
                    ErrorTooltipEnabled="True"                     
                    TargetControlID="txtLookDistance"
                    ClearTextOnInvalid ="false" 
                >                     
                </cc1:MaskedEditExtender>
                <cc1:MaskedEditValidator                 
                ControlExtender="me_txtLookDistance"
                ControlToValidate="txtLookDistance" 
                IsValidEmpty="true"  
                MaximumValue="500" 
                EmptyValueMessage="Введите число 0-100"
                InvalidValueMessage="Неверное значение"
                MaximumValueMessage="Значение > 0"
                MinimumValueMessage="Значение < 500"
                MinimumValue="0" 
                EmptyValueBlurredText="*" 
                InvalidValueBlurredMessage="*" 
                MaximumValueBlurredMessage="*" 
                MinimumValueBlurredText="*"
                Display="Dynamic" 
                TooltipMessage="Введите число: 0-500"                
                ID="mev_txtLookDistance" runat="server"></cc1:MaskedEditValidator>--%>
            </td>
            </tr>
</table>

<%--Изображение--%>
<table width ="100%" cellpadding ="2" cellspacing ="0" >
<asp:ListView ID="lvPhoto" runat="server" 
                        onitemcommand="ItemCommand" onitemediting="ItemEditing" 
                        onitemupdating="ItemUpdating" >
                        <LayoutTemplate>                         
                        <tr runat="server" id="itemPlaceholder" >
                        </tr>
                        </LayoutTemplate>
                        <ItemTemplate  >     
                            <tr >
            <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                Изображение:</td>
            <td  class ="grd_td_item" >                
                            Есть</td>
             <td  class ="grd_td_item" width="15px" style ="text-align :right; "  >
                        <asp:ImageButton ID=ImageButton1  CommandName ="Edit" runat="server"   ImageUrl="~/images/icon-edit.gif" Width="15px" />
            </td>
</tr>                                           
                                                    
                        </ItemTemplate>
                        <EditItemTemplate >
                        <tr >
                        <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                        &nbsp;</td>
                        <td style="width:25%" class ="grd_td_item_caption" >
                            Изображение:</td>
                        <td  class ="grd_td_item" >                
                            &nbsp</td>
                        <td  class ="grd_td_item" width="15px" style ="text-align :right; "  >
                        <asp:ImageButton ID=FotoSave CommandName ="Update" runat="server" ImageUrl ="~/images/icon-save.gif" />                    
                        </td>
                        </tr>
                        <tr >
                        <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                        &nbsp;</td>
                        <td colspan="3" class ="grd_td_item_caption" >
                        <div style="height: 307px">
                                <iframe src =<%# ImageLoaderSrc  %> width ="100%" height ="100%" >
                                </iframe>                
                            </div>
                         </td>                         
                       
                        </tr>
                        
                       <%-- <tr>
                            <td width="3%" style ="vertical-align :top "   >
                            &nbsp;</td>
                        <td width="12%" style ="vertical-align :top" class ="grd_td_item_caption"  >
                        Избражение</td>
                        <td style="width:25%;vertical-align :top;" class ="grd_td_item_caption"   >
                        &nbsp                            
                        </td>
                        <td class ="grd_td_item"   >
                            &nbsp
                        </td>
                        <td width="15px" class ="grd_td_item"  style="text-align :right " >
                        
                        </td>
                        </tr>                 
                        <tr >
                            <td width="3%" >
                                &nbsp;</td>
                            <td width="12%" >
                            &nbsp;</td>
                            <td colspan="3"  style ="text-align :right " >
                            
                            </td>                
                            </tr>        --%>    
                        </EditItemTemplate>
                    </asp:ListView>
 </table>
 
 <%-- <tr>
                            <td width="3%" style ="vertical-align :top "   >
                            &nbsp;</td>
                        <td width="12%" style ="vertical-align :top" class ="grd_td_item_caption"  >
                        Избражение</td>
                        <td style="width:25%;vertical-align :top;" class ="grd_td_item_caption"   >
                        &nbsp                            
                        </td>
                        <td class ="grd_td_item"   >
                            &nbsp
                        </td>
                        <td width="15px" class ="grd_td_item"  style="text-align :right " >
                        
                        </td>
                        </tr>                 
                        <tr >
                            <td width="3%" >
                                &nbsp;</td>
                            <td width="12%" >
                            &nbsp;</td>
                            <td colspan="3"  style ="text-align :right " >
                            
                            </td>                
                            </tr>        --%>
<table style="width:100%;" cellpadding ="2" cellspacing ="0">                
        <asp:ListView ID=lvPriceList runat="server" 
                        onitemcommand="ItemCommand" onitemediting="ItemEditing" 
                        onitemupdating="ItemUpdating" >
                        <LayoutTemplate>
                                <tr runat="server" id="itemPlaceholder" >
                                </tr>                            
                        </LayoutTemplate>                        
                        <ItemTemplate  >    
                        <tr >
                        <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                        &nbsp;</td>
                        <td style="width:25%" class ="grd_td_item_caption" >
                            Цена(сутки):</td>
                        <td  class ="grd_td_item" >                
                            <%# Side.CurrentPrice.ToString() %> </td>
                        <td  class ="grd_td_item" width="15px" style ="text-align :right; "  >
                            <asp:ImageButton ID=ImageButton1  CommandName ="Edit" runat="server"   ImageUrl="~/images/icon-edit.gif" Width="15px" />
                        </td>
                        </tr>                                                                        
                        </ItemTemplate>                        
                        <EditItemTemplate >                        
                        <tr >
                        <td width="25%" style ="vertical-align :top;border-bottom: 0px ;" class ="grd_td_item"  >
                        &nbsp;</td>
                        <td style="width:25%;border-bottom: 0px; vertical-align :top " class ="grd_td_item_caption" >
                            Цена(сутки):
                        </td>
                        <td colspan ="2"  >                                            
                            <div style ="width :100%" >
                             <table style="width:100%;" cellpadding ="2" cellspacing ="0">                                    
                                <tr>                
                <td style ="width:15px" >
                    <asp:ImageButton ID="ImageButton4" OnClick ="btnAddPrice_Click" runat="server" ImageUrl="~/images/add.png" />
                </td>     
                <td  class ="grd_td_item_caption" style ="border-bottom: 0px">
                    Дата</td> 
                <td  class ="grd_td_item_caption" style ="border-bottom: 0px">
                    Сумма</td> 
                    <td  class ="grd_td_item_caption" style ="width:15px; border-bottom: 0px ">
                        <asp:ImageButton ID=ImageButton3 CommandName ="Update" runat="server" ImageUrl ="~/images/icon-save.gif" />   
                    </td> 
                
            </tr>
                <asp:ListView ID="lvPriceListValues" runat="server">            
                 <LayoutTemplate>
                         <tr runat="server" id="itemPlaceholder" >
                        </tr>
                  </LayoutTemplate>       
                 <ItemTemplate  >                         
                  <tr>                
                  <td style ="width:15px; text-align :right " >
                    <asp:ImageButton CommandArgument =<%# Eval("ID") %>  OnClick ="btnRemovePrice_Click" ID=ImageButton3 runat="server" ImageUrl ="~/images/trash.png" />   
                </td> 
                <td  >
                    <asp:TextBox ID="txtDateValue" Text =<%# ((DateTime)Eval("DateValue")).ToShortDateString() %> runat="server" CssClass="datepicker"></asp:TextBox>
                    <cc1:MaskedEditExtender ID="me_txtDateValue"
                    Mask="99/99/9999"
                    runat="server"
                    AutoComplete ="true"                     
                    MessageValidatorTip="true" 
                    OnFocusCssClass="MaskedEditFocus" 
                    OnInvalidCssClass="MaskedEditError"
                    MaskType="Date"  
                    InputDirection="LeftToRight"    
                    AcceptNegative="Left"                     
                    ErrorTooltipEnabled="True"                     
                    TargetControlID="txtDateValue"
                    ClearTextOnInvalid ="false" 
                >                     
                </cc1:MaskedEditExtender>                    
                </td> 
                <td  >
                        
                        <asp:TextBox ID="txtPriceValue" Width ="80%" Text =<%# Eval("Value") %> runat="server" CssClass="TextBox "></asp:TextBox>
                        <cc1:MaskedEditExtender ID="MaskedEditExtender1"                            
                            runat="server"
                            AutoComplete ="true"                     
                            MessageValidatorTip="true" 
                            OnFocusCssClass="MaskedEditFocus" 
                            OnInvalidCssClass="MaskedEditError"
                            Mask="99999"                            
                            InputDirection="LeftToRight"    
                            AcceptNegative="Left"                     
                            ErrorTooltipEnabled="True"                     
                            TargetControlID="txtPriceValue"
                            ClearTextOnInvalid ="false" 
                >                     
                </cc1:MaskedEditExtender>
                </td> 
                
                
            </tr>                      
                  </ItemTemplate>                   
                </asp:ListView>
                            </table>
                            </div>
                        </td>
                        </tr> 
                        </EditItemTemplate>
                    </asp:ListView>
    </table>            
 
<table style="width:100%;" cellpadding ="2" cellspacing ="0">        
<tr >
            <td width="3%" >
                &nbsp;</td>
            <td width="12%" >
                            <asp:HiddenField ID="hfSideID" runat="server" />
                        </td>
            <td colspan="2"  style ="text-align :right " >            
                <asp:Button ID=Button2 runat ="server" CssClass ="btn_wizard" Text ="Сохранить"  OnClick ="btnSave_Click"    />
            </td>
                
            </tr>
 </table> 

                     
                        

            
 
            
            
                     
                        

            
            